#pragma once

#include "Localises.h"

struct TaskbarInfo
{
	TaskbarInfo(void) { taskBar = startButton = oldButton = rebar = NULL; rebarOffset.cx = rebarOffset.cy = 0; bTimer = false; }
	int taskbarId;
	HWND taskBar;
	HWND startButton;
	HWND oldButton;
	HWND rebar;
	SIZE rebarOffset;
	bool bTimer;
	RECT Position;
	RECT TaskBarPosition;
};

extern HINSTANCE g_Instance;
extern HWND g_TaskBar;
extern HWND g_HookWindowHandle;

extern HWND g_ProgWin, g_Rebar;
extern HWND g_WinStartButton, g_StartButtonOld;

static HHOOK g_ProgHook, g_StartHook, g_KeyboardHook, g_AppManagerHook;
static TLocalises g_TransactionStrings;

//################################ Settings Members #############################################

extern bool g_bReplaceButton;
extern bool g_bReplaceAllTasksbars;
extern int  g_BMO, g_BKO, g_SBMO, g_SBKO, g_MBMO, g_TMBMO, g_DMS, g_DHE, g_RAFG, g_CMO, g_CLSO;
extern LPWSTR *g_SBS;
extern int g_DPI;

//################################ Settings Members end #########################################

void InitStartButton();
void CloseStartMenu();
void DestroyStartButton(int taskbarId);
void ShowStartMenu();
void SetDefaultButtonState();

void RecreateStartButton(int taskbarId);
bool PointAroundStartButton(int taskbarId);
HWND GetTaskbarStartButtonFromHandle(HWND handle);
HWND GetTaskbarHandleFromButton(HWND button);
RECT GetTaskbarStartButtonRect(HWND handle);
static TaskbarInfo *FindTaskBarInfoBar(HWND bar);
bool IsTaskbarStartButton(HWND handle);
void CheckTaskbarMoved();
UINT GetTaskbarPosition(HWND taskBar, MONITORINFO *pInfo, HMONITOR *pMonitor, RECT *pRc);
RECT GetStartButtonStartPosition(HWND Button);
RECT GetStartButtonRectFromIndex(int TaskBarID);
UINT GetStartButtonPosition(HWND button);
UINT GetStartButtonPositionFromIndex(int TaskBarID);
UINT GetStartButtonTPosition(HWND taskbar);
bool PointIsInStartButton(POINT Pos);
int GetTaskbars();